home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / SpeechRecognition.a < prev    next >
Text File  |  1996-05-01  |  24KB  |  752 lines

  1. ;
  2. ;    File:        SpeechRecognition.a
  3. ;
  4. ;    Contains:    Apple Speech Recognition Toolbox Interfaces.
  5. ;
  6. ;    Version:    Technology:    PlainTalk 1.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__SPEECHRECOGNITION__') = 'UNDEFINED' THEN
  19. __SPEECHRECOGNITION__ SET 1
  20.  
  21.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  22.     include 'Memory.a'
  23.     ENDIF
  24.     IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
  25. ;  Error Codes [Speech recognition gets -5100 through -5199] 
  26.  
  27. kSRNotAvailable                    EQU        -5100                ; the service requested is not avail or applicable 
  28. kSRInternalError                EQU        -5101                ; a system internal or hardware error condition 
  29. kSRComponentNotFound            EQU        -5102                ; a needed system resource was not located 
  30. kSROutOfMemory                    EQU        -5103                ; an out of memory error occurred in the toolbox memory space 
  31. kSRNotASpeechObject                EQU        -5104                ; the object specified is no longer or never was valid 
  32. kSRBadParameter                    EQU        -5105                ; an invalid parameter was specified 
  33. kSRParamOutOfRange                EQU        -5106                ; when we say 0-100, don't pass in 101. 
  34. kSRBadSelector                    EQU        -5107                ; an unrecognized selector was specified 
  35. kSRBufferTooSmall                EQU        -5108                ; returned from attribute access functions 
  36. kSRNotARecSystem                EQU        -5109                ; the object used was not a SRRecognitionSystem 
  37. kSRFeedbackNotAvail                EQU        -5110                ; there is no feedback window associated with SRRecognizer 
  38. kSRCantSetProperty                EQU        -5111                ; a non-settable property was specified 
  39. kSRCantGetProperty                EQU        -5112                ; a non-gettable property was specified 
  40. kSRCantSetDuringRecognition        EQU        -5113                ; the property can't be set while recognition is in progress -- do before or between utterances. 
  41. kSRAlreadyListening                EQU        -5114                ; in response to SRStartListening 
  42. kSRNotListeningState            EQU        -5115                ; in response to SRStopListening 
  43. kSRModelMismatch                EQU        -5116                ; no acoustical models are avail to match request 
  44. kSRNoClientLanguageModel        EQU        -5117                ; trying to access a non-specified SRLanguageModel 
  45. kSRNoPendingUtterances            EQU        -5118                ; nothing to continue search on 
  46. kSRRecognitionCanceled            EQU        -5119                ; an abort error occurred during search 
  47. kSRRecognitionDone                EQU        -5120                ; search has finished, but nothing was recognized 
  48. kSROtherRecAlreadyModal            EQU        -5121                ; another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now 
  49. kSRHasNoSubItems                EQU        -5122                ; SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. 
  50. kSRSubItemNotFound                EQU        -5123                ; returned when accessing a non-existent sub item of a container 
  51. kSRLanguageModelTooBig            EQU        -5124                ; Cant build language models so big 
  52. kSRAlreadyReleased                EQU        -5125                ; this object has already been released before 
  53. kSRAlreadyFinished                EQU        -5126                ; the language model can't be finished twice 
  54. kSRWordNotFound                    EQU        -5127                ; the spelling couldn't be found in lookup(s) 
  55. kSRNotFinishedWithRejection        EQU        -5128                ; property not found because the LMObj is not finished with rejection 
  56. kSRExpansionTooDeep                EQU        -5129                ; Language model is left recursive or is embedded too many levels 
  57. kSRTooManyElements                EQU        -5130                ; Too many elements added to phrase or path or other langauge model object 
  58. kSRCantAdd                        EQU        -5131                ; Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    
  59. kSRSndInSourceDisconnected        EQU        -5132                ; Sound input source is disconnected 
  60. kSRCantReadLanguageObject        EQU        -5133                ; An error while trying to create new Language object from file or pointer -- possibly bad format 
  61.                                                             ; non-release debugging error codes are included here 
  62. kSRNotImplementedYet            EQU        -5199                ; you'd better wait for this feature in a future release 
  63. ;  Type Definitions 
  64.  
  65.  
  66. ; typedef SRSpeechObject                 SRRecognitionSystem
  67.  
  68. ; typedef SRSpeechObject                 SRRecognizer
  69.  
  70. ; typedef SRSpeechObject                 SRSpeechSource
  71.  
  72. ; typedef SRSpeechSource                 SRRecognitionResult
  73.  
  74. ; typedef SRSpeechObject                 SRLanguageObject
  75.  
  76. ; typedef SRLanguageObject                 SRLanguageModel
  77.  
  78. ; typedef SRLanguageObject                 SRPath
  79.  
  80. ; typedef SRLanguageObject                 SRPhrase
  81.  
  82. ; typedef SRLanguageObject                 SRWord
  83.  
  84. ;  between 0 and 100 
  85. ; typedef unsigned short                 SRSpeedSetting
  86.  
  87. ;  between 0 and 100 
  88. ; typedef unsigned short                 SRRejectionLevel
  89.  
  90. ;  When an event occurs, the user supplied proc will be called with a pointer    
  91. ;     to the param passed in and a flag to indicate conditions such                
  92. ;     as interrupt time or system background time.                                
  93. SRCallBackStruct        RECORD 0
  94. what                     ds.l    1                ; offset: $0 (0)        ;  one of notification flags 
  95. message                     ds.l    1                ; offset: $4 (4)        ;  contains SRRecognitionResult id 
  96. instance                 ds.l    1                ; offset: $8 (8)        ;  ID of recognizer being notified 
  97. status                     ds.w    1                ; offset: $C (12)        ;  result status of last search 
  98. flags                     ds.w    1                ; offset: $E (14)        ;  non-zero if occurs during interrupt 
  99. refCon                     ds.l    1                ; offset: $10 (16)        ;  user defined - set from SRCallBackParam 
  100. sizeof                     EQU *                    ; size:   $14 (20)
  101.                         ENDR
  102. ;  Call back procedure definition 
  103. SRCallBackParam            RECORD 0
  104. callBack                 ds.l    1                ; offset: $0 (0)
  105. refCon                     ds.l    1                ; offset: $4 (4)
  106. sizeof                     EQU *                    ; size:   $8 (8)
  107.                         ENDR
  108. ;  Recognition System Types 
  109.  
  110. kSRDefaultRecognitionSystemID    EQU        0
  111. ;  Recognition System Properties 
  112.  
  113. kSRFeedbackAndListeningModes    EQU        'fbwn'                ; short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes 
  114. kSRRejectedWord                    EQU        'rejq'                ; the SRWord used to represent a rejection 
  115. kSRCleanupOnClientExit            EQU        'clup'                ; Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits 
  116.  
  117. kSRNoFeedbackNoListenModes        EQU        0                    ; next allocated recognizer has no feedback window and doesn't use listening modes    
  118. kSRHasFeedbackHasListenModes    EQU        1                    ; next allocated recognizer has feedback window and uses listening modes             
  119. kSRNoFeedbackHasListenModes        EQU        2                    ; next allocated recognizer has no feedback window but does use listening modes     
  120. ;  Speech Source Types 
  121.  
  122. kSRDefaultSpeechSource            EQU        0
  123. kSRLiveDesktopSpeechSource        EQU        'dklv'                ; live desktop sound input 
  124. kSRCanned22kHzSpeechSource        EQU        'ca22'                ; AIFF file based 16 bit, 22.050 KHz sound input 
  125. ;  Notification via Apple Event or Callback 
  126. ;  Notification Flags 
  127.  
  128. kSRNotifyRecognitionBeginning    EQU        $00000001            ; recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition 
  129. kSRNotifyRecognitionDone        EQU        $00000002            ; recognition has terminated. result (if any) is available. 
  130. ;  Apple Event selectors 
  131. ;  AppleEvent message class  
  132.  
  133. kAESpeechSuite                    EQU        'sprc'
  134. ;  AppleEvent message event ids 
  135.  
  136. kAESpeechDone                    EQU        'srsd'
  137. kAESpeechDetected                EQU        'srbd'
  138. ;  AppleEvent Parameter ids 
  139.  
  140. keySRRecognizer                    EQU        'krec'
  141. keySRSpeechResult                EQU        'kspr'
  142. keySRSpeechStatus                EQU        'ksst'
  143. ;  AppleEvent Parameter types 
  144.  
  145. typeSRRecognizer                EQU        'trec'
  146. typeSRSpeechResult                EQU        'tspr'
  147. ;  SRRecognizer Properties 
  148.  
  149. kSRNotificationParam            EQU        'noti'                ; see notification flags below 
  150. kSRCallBackParam                EQU        'call'                ; type SRCallBackParam 
  151. kSRSearchStatusParam            EQU        'stat'                ; see status flags below 
  152. kSRAutoFinishingParam            EQU        'afin'                ; automatic finishing applied on LM for search 
  153. kSRForegroundOnly                EQU        'fgon'                ; Boolean. Default is true. If true, client recognizer only active when in foreground.    
  154. kSRBlockBackground                EQU        'blbg'                ; Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    
  155. kSRBlockModally                    EQU        'blmd'                ; Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! 
  156. kSRWantsResultTextDrawn            EQU        'txfb'                ; Boolean. Default is true. If true, search results are posted to Feedback window 
  157. kSRWantsAutoFBGestures            EQU        'dfbr'                ; Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior 
  158. kSRSoundInVolume                EQU        'volu'                ; short in [0..100] log scaled sound input power. Can't set this property 
  159. kSRReadAudioFSSpec                EQU        'aurd'                ; *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF 
  160. kSRCancelOnSoundOut                EQU        'caso'                ; Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. 
  161. kSRSpeedVsAccuracyParam            EQU        'sped'                ; SRSpeedSetting between 0 and 100 
  162. ;  0 means more accurate but slower. 
  163. ;  100 means (much) less accurate but faster. 
  164.  
  165. kSRUseToggleListen                EQU        0                    ; listen key modes 
  166. kSRUsePushToTalk                EQU        1
  167.  
  168. kSRListenKeyMode                EQU        'lkmd'                ; short: either kSRUseToggleListen or kSRUsePushToTalk 
  169. kSRListenKeyCombo                EQU        'lkey'                ; short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message 
  170. kSRListenKeyName                EQU        'lnam'                ; Str63: string representing ListenKeyCombo 
  171. kSRKeyWord                        EQU        'kwrd'                ; Str255: keyword preceding spoken commands in kSRUseToggleListen mode 
  172. kSRKeyExpected                    EQU        'kexp'                ; Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? 
  173. ;  Operational Status Flags 
  174.  
  175. kSRIdleRecognizer                EQU        $00000001            ; engine is not active 
  176. kSRSearchInProgress                EQU        $00000002            ; search is in progress 
  177. kSRSearchWaitForAllClients        EQU        $00000004            ; search is suspended waiting on all clients' input 
  178. kSRMustCancelSearch                EQU        $00000008            ; something has occurred (sound played, non-speech detected) requiring the search to abort 
  179. kSRPendingSearch                EQU        $00000010            ; we're about to start searching 
  180. ;  Recognition Result Properties 
  181.  
  182. kSRTEXTFormat                    EQU        'TEXT'                ; raw text in user supplied memory 
  183. kSRPhraseFormat                    EQU        'lmph'                ; SRPhrase containing result words 
  184. kSRPathFormat                    EQU        'lmpt'                ; SRPath containing result phrases or words 
  185. kSRLanguageModelFormat            EQU        'lmfm'                ; top level SRLanguageModel for post parse 
  186. ;  SRLanguageObject Family Properties 
  187.  
  188. kSRSpelling                        EQU        'spel'                ; spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel 
  189. kSRLMObjType                    EQU        'lmtp'                ; Returns one of SRLanguageObject Types listed below 
  190. kSRRefCon                        EQU        'refc'                ; 4 bytes of user storage 
  191. kSROptional                        EQU        'optl'                ; Boolean -- true if SRLanguageObject is optional    
  192. kSREnabled                        EQU        'enbl'                ; Boolean -- true if SRLanguageObject enabled 
  193. kSRRepeatable                    EQU        'rptb'                ; Boolean -- true if SRLanguageObject is repeatable 
  194. kSRRejectable                    EQU        'rjbl'                ; Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord 
  195.                                                             ;        object can be returned in place of SRLanguageObject with this property)    
  196. kSRRejectionLevel                EQU        'rjct'                ; SRRejectionLevel between 0 and 100 
  197. ;  LM Object Types -- returned as kSRLMObjType property of language model objects 
  198.  
  199. kSRLanguageModelType            EQU        'lmob'                ; SRLanguageModel 
  200. kSRPathType                        EQU        'path'                ; SRPath 
  201. kSRPhraseType                    EQU        'phra'                ; SRPhrase 
  202. kSRWordType                        EQU        'word'                ; SRWord 
  203. ;  a normal and reasonable rejection level 
  204.  
  205. kSRDefaultRejectionLevel        EQU        50
  206. ; ******************************************************************************
  207. ;                         NOTES ON USING THE API                                    
  208. ;                                                                                 
  209. ;         All operations (with the exception of SRGetRecognitionSystem) are        
  210. ;         directed toward an object allocated or begot from New, Get and Read        
  211. ;         type calls.                                                                
  212. ;                                                                                 
  213. ;         There is a simple rule in dealing with allocation and disposal:            
  214. ;                                                                                 
  215. ;         *    all toolbox allocations are obtained from a SRRecognitionSystem        
  216. ;                                                                                 
  217. ;         *    if you obtain an object via New or Get, then you own a reference     
  218. ;             to that object and it must be released via SRReleaseObject when        
  219. ;             you no longer need it                                                
  220. ;                                                                                 
  221. ;         *    when you receive a SRRecognitionResult object via AppleEvent or        
  222. ;             callback, it has essentially been created on your behalf and so        
  223. ;             you are responsible for releasing it as above                        
  224. ;                                                                                 
  225. ;         *    when you close a SRRecognitionSystem, all remaining objects which        
  226. ;             were allocated with it will be forcefully released and any            
  227. ;             remaining references to those objects will be invalid.                
  228. ;                                                                                 
  229. ;         This translates into a very simple guideline:                            
  230. ;             If you allocate it or have it allocated for you, you must release    
  231. ;             it.  If you are only peeking at it, then don't release it.            
  232. ;                                                                                 
  233. ; ******************************************************************************
  234. ;  Opening and Closing of the SRRecognitionSystem 
  235. ;
  236. ; pascal OSErr SROpenRecognitionSystem(SRRecognitionSystem *system, OSType systemID)
  237. ;
  238.     IF ¨ GENERATINGCFM THEN
  239.         Macro
  240.         _SROpenRecognitionSystem
  241.             move.w              #$0400,D0
  242.             dc.w                $AA56
  243.         EndM
  244.     ELSE
  245.         IMPORT_CFM_FUNCTION SROpenRecognitionSystem
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal OSErr SRCloseRecognitionSystem(SRRecognitionSystem system)
  250. ;
  251.     IF ¨ GENERATINGCFM THEN
  252.         Macro
  253.         _SRCloseRecognitionSystem
  254.             move.w              #$0201,D0
  255.             dc.w                $AA56
  256.         EndM
  257.     ELSE
  258.         IMPORT_CFM_FUNCTION SRCloseRecognitionSystem
  259.     ENDIF
  260.  
  261. ;  Accessing Properties of any Speech Object 
  262. ;
  263. ; pascal OSErr SRSetProperty(SRSpeechObject srObject, OSType selector, const void *property, Size propertyLen)
  264. ;
  265.     IF ¨ GENERATINGCFM THEN
  266.         Macro
  267.         _SRSetProperty
  268.             move.w              #$0802,D0
  269.             dc.w                $AA56
  270.         EndM
  271.     ELSE
  272.         IMPORT_CFM_FUNCTION SRSetProperty
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal OSErr SRGetProperty(SRSpeechObject srObject, OSType selector, void *property, Size *propertyLen)
  277. ;
  278.     IF ¨ GENERATINGCFM THEN
  279.         Macro
  280.         _SRGetProperty
  281.             move.w              #$0803,D0
  282.             dc.w                $AA56
  283.         EndM
  284.     ELSE
  285.         IMPORT_CFM_FUNCTION SRGetProperty
  286.     ENDIF
  287.  
  288. ;  Any object obtained via New or Get type calls must be released 
  289. ;
  290. ; pascal OSErr SRReleaseObject(SRSpeechObject srObject)
  291. ;
  292.     IF ¨ GENERATINGCFM THEN
  293.         Macro
  294.         _SRReleaseObject
  295.             move.w              #$0204,D0
  296.             dc.w                $AA56
  297.         EndM
  298.     ELSE
  299.         IMPORT_CFM_FUNCTION SRReleaseObject
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal OSErr SRGetReference(SRSpeechObject srObject, SRSpeechObject *newObjectRef)
  304. ;
  305.     IF ¨ GENERATINGCFM THEN
  306.         Macro
  307.         _SRGetReference
  308.             move.w              #$0425,D0
  309.             dc.w                $AA56
  310.         EndM
  311.     ELSE
  312.         IMPORT_CFM_FUNCTION SRGetReference
  313.     ENDIF
  314.  
  315. ;  SRRecognizer Instance Functions 
  316. ;
  317. ; pascal OSErr SRNewRecognizer(SRRecognitionSystem system, SRRecognizer *recognizer, OSType sourceID)
  318. ;
  319.     IF ¨ GENERATINGCFM THEN
  320.         Macro
  321.         _SRNewRecognizer
  322.             move.w              #$060A,D0
  323.             dc.w                $AA56
  324.         EndM
  325.     ELSE
  326.         IMPORT_CFM_FUNCTION SRNewRecognizer
  327.     ENDIF
  328.  
  329. ;
  330. ; pascal OSErr SRStartListening(SRRecognizer recognizer)
  331. ;
  332.     IF ¨ GENERATINGCFM THEN
  333.         Macro
  334.         _SRStartListening
  335.             move.w              #$020C,D0
  336.             dc.w                $AA56
  337.         EndM
  338.     ELSE
  339.         IMPORT_CFM_FUNCTION SRStartListening
  340.     ENDIF
  341.  
  342. ;
  343. ; pascal OSErr SRStopListening(SRRecognizer recognizer)
  344. ;
  345.     IF ¨ GENERATINGCFM THEN
  346.         Macro
  347.         _SRStopListening
  348.             move.w              #$020D,D0
  349.             dc.w                $AA56
  350.         EndM
  351.     ELSE
  352.         IMPORT_CFM_FUNCTION SRStopListening
  353.     ENDIF
  354.  
  355. ;
  356. ; pascal OSErr SRSetLanguageModel(SRRecognizer recognizer, SRLanguageModel languageModel)
  357. ;
  358.     IF ¨ GENERATINGCFM THEN
  359.         Macro
  360.         _SRSetLanguageModel
  361.             move.w              #$040E,D0
  362.             dc.w                $AA56
  363.         EndM
  364.     ELSE
  365.         IMPORT_CFM_FUNCTION SRSetLanguageModel
  366.     ENDIF
  367.  
  368. ;
  369. ; pascal OSErr SRGetLanguageModel(SRRecognizer recognizer, SRLanguageModel *languageModel)
  370. ;
  371.     IF ¨ GENERATINGCFM THEN
  372.         Macro
  373.         _SRGetLanguageModel
  374.             move.w              #$040F,D0
  375.             dc.w                $AA56
  376.         EndM
  377.     ELSE
  378.         IMPORT_CFM_FUNCTION SRGetLanguageModel
  379.     ENDIF
  380.  
  381. ;
  382. ; pascal OSErr SRContinueRecognition(SRRecognizer recognizer)
  383. ;
  384.     IF ¨ GENERATINGCFM THEN
  385.         Macro
  386.         _SRContinueRecognition
  387.             move.w              #$0210,D0
  388.             dc.w                $AA56
  389.         EndM
  390.     ELSE
  391.         IMPORT_CFM_FUNCTION SRContinueRecognition
  392.     ENDIF
  393.  
  394. ;
  395. ; pascal OSErr SRCancelRecognition(SRRecognizer recognizer)
  396. ;
  397.     IF ¨ GENERATINGCFM THEN
  398.         Macro
  399.         _SRCancelRecognition
  400.             move.w              #$0211,D0
  401.             dc.w                $AA56
  402.         EndM
  403.     ELSE
  404.         IMPORT_CFM_FUNCTION SRCancelRecognition
  405.     ENDIF
  406.  
  407. ;
  408. ; pascal OSErr SRIdle(void )
  409. ;
  410.     IF ¨ GENERATINGCFM THEN
  411.         Macro
  412.         _SRIdle
  413.             move.w              #$0028,D0
  414.             dc.w                $AA56
  415.         EndM
  416.     ELSE
  417.         IMPORT_CFM_FUNCTION SRIdle
  418.     ENDIF
  419.  
  420. ;  Language Model Building and Manipulation Functions 
  421. ;
  422. ; pascal OSErr SRNewLanguageModel(SRRecognitionSystem system, SRLanguageModel *model, const void *name, Size nameLength)
  423. ;
  424.     IF ¨ GENERATINGCFM THEN
  425.         Macro
  426.         _SRNewLanguageModel
  427.             move.w              #$0812,D0
  428.             dc.w                $AA56
  429.         EndM
  430.     ELSE
  431.         IMPORT_CFM_FUNCTION SRNewLanguageModel
  432.     ENDIF
  433.  
  434. ;
  435. ; pascal OSErr SRNewPath(SRRecognitionSystem system, SRPath *path)
  436. ;
  437.     IF ¨ GENERATINGCFM THEN
  438.         Macro
  439.         _SRNewPath
  440.             move.w              #$0413,D0
  441.             dc.w                $AA56
  442.         EndM
  443.     ELSE
  444.         IMPORT_CFM_FUNCTION SRNewPath
  445.     ENDIF
  446.  
  447. ;
  448. ; pascal OSErr SRNewPhrase(SRRecognitionSystem system, SRPhrase *phrase, const void *text, Size textLength)
  449. ;
  450.     IF ¨ GENERATINGCFM THEN
  451.         Macro
  452.         _SRNewPhrase
  453.             move.w              #$0814,D0
  454.             dc.w                $AA56
  455.         EndM
  456.     ELSE
  457.         IMPORT_CFM_FUNCTION SRNewPhrase
  458.     ENDIF
  459.  
  460. ;
  461. ; pascal OSErr SRNewWord(SRRecognitionSystem system, SRWord *word, const void *text, Size textLength)
  462. ;
  463.     IF ¨ GENERATINGCFM THEN
  464.         Macro
  465.         _SRNewWord
  466.             move.w              #$0815,D0
  467.             dc.w                $AA56
  468.         EndM
  469.     ELSE
  470.         IMPORT_CFM_FUNCTION SRNewWord
  471.     ENDIF
  472.  
  473. ;  Operations on any object of the SRLanguageObject family 
  474. ;
  475. ; pascal OSErr SRPutLanguageObjectIntoHandle(SRLanguageObject languageObject, Handle lobjHandle)
  476. ;
  477.     IF ¨ GENERATINGCFM THEN
  478.         Macro
  479.         _SRPutLanguageObjectIntoHandle
  480.             move.w              #$0416,D0
  481.             dc.w                $AA56
  482.         EndM
  483.     ELSE
  484.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoHandle
  485.     ENDIF
  486.  
  487. ;
  488. ; pascal OSErr SRPutLanguageObjectIntoDataFile(SRLanguageObject languageObject, short fRefNum)
  489. ;
  490.     IF ¨ GENERATINGCFM THEN
  491.         Macro
  492.         _SRPutLanguageObjectIntoDataFile
  493.             move.w              #$0328,D0
  494.             dc.w                $AA56
  495.         EndM
  496.     ELSE
  497.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoDataFile
  498.     ENDIF
  499.  
  500. ;
  501. ; pascal OSErr SRNewLanguageObjectFromHandle(SRRecognitionSystem system, SRLanguageObject *languageObject, Handle lObjHandle)
  502. ;
  503.     IF ¨ GENERATINGCFM THEN
  504.         Macro
  505.         _SRNewLanguageObjectFromHandle
  506.             move.w              #$0417,D0
  507.             dc.w                $AA56
  508.         EndM
  509.     ELSE
  510.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromHandle
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal OSErr SRNewLanguageObjectFromDataFile(SRRecognitionSystem system, SRLanguageObject *languageObject, short fRefNum)
  515. ;
  516.     IF ¨ GENERATINGCFM THEN
  517.         Macro
  518.         _SRNewLanguageObjectFromDataFile
  519.             move.w              #$0427,D0
  520.             dc.w                $AA56
  521.         EndM
  522.     ELSE
  523.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromDataFile
  524.     ENDIF
  525.  
  526. ;
  527. ; pascal OSErr SREmptyLanguageObject(SRLanguageObject languageObject)
  528. ;
  529.     IF ¨ GENERATINGCFM THEN
  530.         Macro
  531.         _SREmptyLanguageObject
  532.             move.w              #$0218,D0
  533.             dc.w                $AA56
  534.         EndM
  535.     ELSE
  536.         IMPORT_CFM_FUNCTION SREmptyLanguageObject
  537.     ENDIF
  538.  
  539. ;
  540. ; pascal OSErr SRChangeLanguageObject(SRLanguageObject languageObject, const void *text, Size textLength)
  541. ;
  542.     IF ¨ GENERATINGCFM THEN
  543.         Macro
  544.         _SRChangeLanguageObject
  545.             move.w              #$0619,D0
  546.             dc.w                $AA56
  547.         EndM
  548.     ELSE
  549.         IMPORT_CFM_FUNCTION SRChangeLanguageObject
  550.     ENDIF
  551.  
  552. ;
  553. ; pascal OSErr SRAddLanguageObject(SRLanguageObject base, SRLanguageObject addon)
  554. ;
  555.     IF ¨ GENERATINGCFM THEN
  556.         Macro
  557.         _SRAddLanguageObject
  558.             move.w              #$041A,D0
  559.             dc.w                $AA56
  560.         EndM
  561.     ELSE
  562.         IMPORT_CFM_FUNCTION SRAddLanguageObject
  563.     ENDIF
  564.  
  565. ;
  566. ; pascal OSErr SRAddText(SRLanguageObject base, const void *text, Size textLength, long refCon)
  567. ;
  568.     IF ¨ GENERATINGCFM THEN
  569.         Macro
  570.         _SRAddText
  571.             move.w              #$081B,D0
  572.             dc.w                $AA56
  573.         EndM
  574.     ELSE
  575.         IMPORT_CFM_FUNCTION SRAddText
  576.     ENDIF
  577.  
  578. ;
  579. ; pascal OSErr SRRemoveLanguageObject(SRLanguageObject base, SRLanguageObject toRemove)
  580. ;
  581.     IF ¨ GENERATINGCFM THEN
  582.         Macro
  583.         _SRRemoveLanguageObject
  584.             move.w              #$041C,D0
  585.             dc.w                $AA56
  586.         EndM
  587.     ELSE
  588.         IMPORT_CFM_FUNCTION SRRemoveLanguageObject
  589.     ENDIF
  590.  
  591. ;  Traversing SRRecognitionResults or SRLanguageObjects 
  592. ;
  593. ; pascal OSErr SRCountItems(SRSpeechObject container, long *count)
  594. ;
  595.     IF ¨ GENERATINGCFM THEN
  596.         Macro
  597.         _SRCountItems
  598.             move.w              #$0405,D0
  599.             dc.w                $AA56
  600.         EndM
  601.     ELSE
  602.         IMPORT_CFM_FUNCTION SRCountItems
  603.     ENDIF
  604.  
  605. ;
  606. ; pascal OSErr SRGetIndexedItem(SRSpeechObject container, SRSpeechObject *item, long index)
  607. ;
  608.     IF ¨ GENERATINGCFM THEN
  609.         Macro
  610.         _SRGetIndexedItem
  611.             move.w              #$0606,D0
  612.             dc.w                $AA56
  613.         EndM
  614.     ELSE
  615.         IMPORT_CFM_FUNCTION SRGetIndexedItem
  616.     ENDIF
  617.  
  618. ;
  619. ; pascal OSErr SRSetIndexedItem(SRSpeechObject container, SRSpeechObject item, long index)
  620. ;
  621.     IF ¨ GENERATINGCFM THEN
  622.         Macro
  623.         _SRSetIndexedItem
  624.             move.w              #$0607,D0
  625.             dc.w                $AA56
  626.         EndM
  627.     ELSE
  628.         IMPORT_CFM_FUNCTION SRSetIndexedItem
  629.     ENDIF
  630.  
  631. ;
  632. ; pascal OSErr SRRemoveIndexedItem(SRSpeechObject container, long index)
  633. ;
  634.     IF ¨ GENERATINGCFM THEN
  635.         Macro
  636.         _SRRemoveIndexedItem
  637.             move.w              #$0408,D0
  638.             dc.w                $AA56
  639.         EndM
  640.     ELSE
  641.         IMPORT_CFM_FUNCTION SRRemoveIndexedItem
  642.     ENDIF
  643.  
  644. ;  Utilizing the System Feedback Window 
  645. ;
  646. ; pascal OSErr SRDrawText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  647. ;
  648.     IF ¨ GENERATINGCFM THEN
  649.         Macro
  650.         _SRDrawText
  651.             move.w              #$0621,D0
  652.             dc.w                $AA56
  653.         EndM
  654.     ELSE
  655.         IMPORT_CFM_FUNCTION SRDrawText
  656.     ENDIF
  657.  
  658. ;
  659. ; pascal OSErr SRDrawRecognizedText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  660. ;
  661.     IF ¨ GENERATINGCFM THEN
  662.         Macro
  663.         _SRDrawRecognizedText
  664.             move.w              #$0622,D0
  665.             dc.w                $AA56
  666.         EndM
  667.     ELSE
  668.         IMPORT_CFM_FUNCTION SRDrawRecognizedText
  669.     ENDIF
  670.  
  671. ;
  672. ; pascal OSErr SRSpeakText(SRRecognizer recognizer, const void *speakText, Size speakLength)
  673. ;
  674.     IF ¨ GENERATINGCFM THEN
  675.         Macro
  676.         _SRSpeakText
  677.             move.w              #$0620,D0
  678.             dc.w                $AA56
  679.         EndM
  680.     ELSE
  681.         IMPORT_CFM_FUNCTION SRSpeakText
  682.     ENDIF
  683.  
  684. ;
  685. ; pascal OSErr SRSpeakAndDrawText(SRRecognizer recognizer, const void *text, Size textLength)
  686. ;
  687.     IF ¨ GENERATINGCFM THEN
  688.         Macro
  689.         _SRSpeakAndDrawText
  690.             move.w              #$061F,D0
  691.             dc.w                $AA56
  692.         EndM
  693.     ELSE
  694.         IMPORT_CFM_FUNCTION SRSpeakAndDrawText
  695.     ENDIF
  696.  
  697. ;
  698. ; pascal OSErr SRStopSpeech(SRRecognizer recognizer)
  699. ;
  700.     IF ¨ GENERATINGCFM THEN
  701.         Macro
  702.         _SRStopSpeech
  703.             move.w              #$0223,D0
  704.             dc.w                $AA56
  705.         EndM
  706.     ELSE
  707.         IMPORT_CFM_FUNCTION SRStopSpeech
  708.     ENDIF
  709.  
  710. ;
  711. ; pascal Boolean SRSpeechBusy(SRRecognizer recognizer)
  712. ;
  713.     IF ¨ GENERATINGCFM THEN
  714.         Macro
  715.         _SRSpeechBusy
  716.             move.w              #$0224,D0
  717.             dc.w                $AA56
  718.         EndM
  719.     ELSE
  720.         IMPORT_CFM_FUNCTION SRSpeechBusy
  721.     ENDIF
  722.  
  723. ;
  724. ; pascal OSErr SRProcessBegin(SRRecognizer recognizer, Boolean failed)
  725. ;
  726.     IF ¨ GENERATINGCFM THEN
  727.         Macro
  728.         _SRProcessBegin
  729.             move.w              #$031D,D0
  730.             dc.w                $AA56
  731.         EndM
  732.     ELSE
  733.         IMPORT_CFM_FUNCTION SRProcessBegin
  734.     ENDIF
  735.  
  736. ;
  737. ; pascal OSErr SRProcessEnd(SRRecognizer recognizer, Boolean failed)
  738. ;
  739.     IF ¨ GENERATINGCFM THEN
  740.         Macro
  741.         _SRProcessEnd
  742.             move.w              #$031E,D0
  743.             dc.w                $AA56
  744.         EndM
  745.     ELSE
  746.         IMPORT_CFM_FUNCTION SRProcessEnd
  747.     ENDIF
  748.  
  749.     ENDIF
  750.     ENDIF ; __SPEECHRECOGNITION__ 
  751.  
  752.